
import request from '@/utils/request'

// 查询巴体列表
export function listAmoeba(query) {
    return request({
        url: '/system/amoeba/list',
        method: 'get',
        params: query
    })
}
// 查询巴体列表（排除节点）
export function listAmoebaExcludeChild(amoebaId) {
    return request({
        url: '/system/amoeba/list/exclude/' + amoebaId,
        method: 'get'
    })
}
// 查询巴体详细
export function getAmoebaDetail(amoebaId) {
    return request({
        url: '/system/amoeba/' + amoebaId,
        method: 'get'
    })
}
// 新增巴体
export function addAmoeba(data) {
    return request({
      url: '/system/amoeba',
      method: 'post',
      data: data
    })
  }
// 修改巴体
export function updateAmoeba(data) {
    return request({
        url: '/system/amoeba',
        method: 'put',
        data: data
    })
}

// 删除巴体
export function delAmoeba(amoebaId) {
    return request({
        url: '/system/amoeba/' + amoebaId,
        method: 'delete'
    })
}

// 切换巴体状态
export function changeAmoebaState(data) {
    return request({
        url: '/system/amoeba/changeDelFlag',
        method: 'post',
        data: data
    })
}

// 通过巴体id获取所属人员
export function getUserListByAmoebaId(query) {
    return request({
        url: '/system/user/getUserListByAmoebaId',
        method: 'get',
        params: query
    })
}



